package com.learn.eduorder.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.learn.eduapi.entity.order.PayOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PayOrderDao extends BaseMapper<PayOrder> {
    @Update("update pay_order set status = #{status} where order_no = #{orderNo}")
    int updatePayOrder(PayOrder payOrder);

    @Select("select * from pay_order where user_id = #{userId} and status = 2")
    List<PayOrder> selectByUserId(@Param("userId") Integer userId);

}
